/// @description: 店铺配置
/// @author tangzhentao
/// @created at 00:27 2025/3/2
library;

import 'package:gold/base/config.dart';

/// 店铺订单状态集合
final shopOrderStatusList = ['', OrderStatus.paying, OrderStatus.sending, OrderStatus.receiving, OrderStatus.done];

/// 获取店铺订单状态的下标
/// [status] 订单状态[OrderStatus]
int getShopOrderStatusIndex(String? status) {
  switch(status) {
    case OrderStatus.paying:
      return 1;
    case OrderStatus.sending:
      return 2;
    case OrderStatus.receiving:
      return 3;
    case OrderStatus.authorized:
      return 4;
    case OrderStatus.done:
      return 5;
    case OrderStatus.reviewing:
      return 6;
    case OrderStatus.cancel:
      return 7;
    default:
      return 0;
  }
}

/// 获取点剖订单状态的描述
/// [status] 订单状态[OrderStatus]
String getShopOrderStatusDesc(String? status) {
  switch(status) {
    case OrderStatus.paying:
      return '待支付';
    case OrderStatus.sending:
      return '待发货';
    case OrderStatus.receiving:
      return '待收货';
    case OrderStatus.reviewing:
      return '待评价';
    case OrderStatus.authorized:
      return '已授权';
    case OrderStatus.done:
      return '已完成';
    case OrderStatus.cancel:
      return '已取消';
    default:
      return '全部';
  }
}